



 
  
/* Can social welfare buy mass loyalty  */
/* Wenhui Yang, Xiaoxiao Shen       */
/* Sep 29, 2020                            				  */
/* Replication code for all figures */




clear
graph drop _all
set matsize 5000
set more off




use "NRPP202009.dta",clear
 



 
**********************************************************************
**Figure 1
*********************************************************************


 
	rdplot NRPP agediff if age<=66&age>=54&age!=60,    p(1)  binselect( esmvpr )   ///
                    graph_options(title()  xline(0) xlabel(-6[2]6)   ylabel(0[0.2]0.8) ///
                     ytitle(Proportion of NRPP,height(5)) legend(off) ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     graphregion(color(white)))
 
  graph export "first.png", as(png) replace
	
 
 
 
 
**********************************************************************
**Figure 2
*********************************************************************


use "NRPP202009.dta", clear

		 
**local governmnent
rdplot perfm agediff if age<=66&age>=54,   c(0) p(1) binselect(qspr)       ///
                    graph_options(title(Satisfaction with local government,size(medsmall))  xline(0) xlabel(-6[2]6) ylabel(3.2[0.2]3.8)  ///
                     ytitle("Local government",size(medsmall)) legend(off) ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     title("Panel A: Local Government (CFPS)", size(small))  graphregion(color(white)))
graph save Graph "fa.gph", replace



**local official
rdplot trustcadre1 agediff if age<=66&age>=54,    c(0) p(1) binselect(qspr) ///
                    graph_options(title(Trust in Local Cadres,size(medsmall))  xline(0) xlabel(-6[2]6)  ylabel(2.8[0.2]3.4)   ///
                     ytitle("Local cadres",size(medsmall)) legend(off) ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     title("Panel B: Local Cadre (CFPS)", size(small))  graphregion(color(white)))
graph save Graph "fb.gph", replace



 
 
 ***central governnent
 
  use "CGSS2010.dta", clear
  

  
rdplot trust_central agediff if age<=66&age>=54,    c(0) p(1) binselect(qspr) ///
                    graph_options(title(Trust in Local Cadres,size(medsmall))  xline(0) xlabel(-6[2]6)  ylabel(4.2[0.2]4.8)  ///
                     ytitle("Central Government",size(medsmall)) legend(off) ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                      title("Panel C: Central Government (CGSS)", size(small)) graphregion(color(white)))
graph save Graph "fc.gph", replace
  
  
  
 

gr combine fa.gph  fb.gph fc.gph , subtitle(, color(black) fcolor(white) lcolor(white)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))	graphregion(fcolor(white)) row(2) 	
erase fa.gph
erase fb.gph
erase fc.gph
 
 




 
**********************************************************************
**Figure 3
*********************************************************************


use "NRPP202009.dta", clear
	
	
***individual wellbeing		
rdplot satis agediff if age<=66&age>=54,  c(0) p(1) binselect(qspr)       ///
                    graph_options(title("Life Satisfaction",size(medsmall))  xline(0) xlabel(-6[2]6) ylabel(3.4[0.2]4)  ///
                     ytitle("Level of life satisfaction",height(5)) legend(off)  ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)    ///
                     graphregion(color(white)))
graph save Graph "satis.gph", replace
		
						 
					 
					
rdplot logconsump  agediff if age<=66&age>=54,  c(0) p(1) binselect(qspr)    ///
                    graph_options(title("Main Consumption",size(medsmall))  xline(0) xlabel(-6[2]6) ylabel(7.5[0.5]8.5) ///
                     ytitle("Main consumption",height(5)) legend(off)  ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     graphregion(color(white)))
graph save Graph "consum.gph", replace



	
							
rdplot  logmedical_exp   agediff if age<=66&age>=54,  c(0) p(1) binselect(qspr)  ///
                    graph_options(title(Medical Consumption,size(medsmall))  xline(0) xlabel(-6[2]6) ylabel(6.5[0.5]7.5) ///
                     ytitle("Medical consumption",height(5)) legend(off) ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     graphregion(color(white)))	
graph save Graph "consum1.gph", replace		


rdplot  logcloth_exp   agediff if age<=66&age>=54,  c(0) p(1) binselect(qspr)    ///
                    graph_options(title(Clothing Consumption,size(medsmall))  xline(0) xlabel(-6[2]6) ylabel(5.5[0.5]7)  ///
                     ytitle("Clothing Consumption",height(5)) legend(off)   ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     graphregion(color(white)))		

graph save Graph "consum2.gph", replace		

					 
rdplot   logfood_exp   agediff if age<=66&age>=54,  c(0) p(1) binselect(qspr)    ///
                    graph_options(title(Food Consumption,size(medsmall))  xline(0) xlabel(-6[2]6)   ylabel(5[0.5]6.5)   ///
                     ytitle("Food Consumption",height(5)) legend(off)  ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     graphregion(color(white)))	
graph save Graph "consum3.gph", replace		


					 
rdplot   logentertain_exp   agediff if age<=66&age>=54,  c(0) p(1) binselect(qspr)    ///
                    graph_options(title(Entertainment Consumption,size(medsmall))  xline(0) xlabel(-6[2]6)  ylabel(0.5[0.1]1) ///
                     ytitle("Entertainment Consumption",height(5)) legend(off)   ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     graphregion(color(white)))	
graph save Graph "consum4.gph", replace		


gr combine   "satis.gph" "consum.gph" "consum1.gph" "consum2.gph" "consum3.gph" "consum4.gph" , rows(2) cols(3) ///
	subtitle(, color(black) fcolor(white) lcolor(white)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))
	
 graph export "wellbeing.png", as(png) replace
	

foreach x in satis consum consum1 consum2 consum3 consum4{		
erase "`x'.gph" 
}
 *
 
 
 
**********************************************************************
**Figure 4
*********************************************************************



****for local government support without control
local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

quietly ivreg2  perfm (NRPP`x' =agedummy )    agediff  agediff_agedummy    if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
quietly ivreg2  perfm (NRPP`x' =agedummy )    agediff  agediff_agedummy    if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
           drop( agediff agediff_agedummy  _cons)  yline(0) title("Panel A: Local Government (baseline)",size(normarlsize))  ytitle("Effect of NRPP on Local Political Support", height(5) size(small)) ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)    xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
  
graph save "fa", replace			  
	



****for local government support with county covariant and prov fixed
local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

xi:quietly ivreg2  perfm (NRPP`x' =agedummy )    agediff  agediff_agedummy  slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov    if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
xi:quietly ivreg2  perfm (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
           drop( agediff agediff_agedummy  _cons _Iprov_* slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 )  yline(0) title("Panel B: Local Government (county covariant + province FE)", size(normarlsize))  ysc(off)   ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)  xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
  
graph save "fb", replace			  
	
	
	

****for local cadre without control
local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

quietly ivreg2  trustcadre1 (NRPP`x' =agedummy )    agediff  agediff_agedummy    if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
quietly ivreg2  trustcadre1 (NRPP`x' =agedummy )    agediff  agediff_agedummy    if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
           drop( agediff agediff_agedummy  _cons)  yline(0) title("Panel C: Local Cadre (baseline)", size(normarlsize))  ytitle("Effect of NRPP on Local Political Support", height(5) size(small)) ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)  xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
  
graph save "fc", replace			  
	



****for local cadre with county covariant and prov fixed
local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

xi:quietly ivreg2  trustcadre1 (NRPP`x' =agedummy )    agediff  agediff_agedummy  slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov    if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
xi:quietly ivreg2  trustcadre1 (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
           drop( agediff agediff_agedummy  _cons _Iprov_* slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966)  yline(0) title("Panel D: Local Cadre (county covariant + province FE)", size(normarlsize))  ysc(off)   ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)  xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
  
graph save "fd", replace			


graph combine fa.gph fb.gph fc.gph  fd.gph ,altshrink scheme(s1mono)	graphregion(fcolor(white)) row(2) 			  
erase fa.gph
erase fb.gph
erase fc.gph
erase fd.gph






**********************************************************************
**Figure 5
*********************************************************************



***for life satisfaction,  baseline


local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

quietly ivreg2   satis  (NRPP`x' =agedummy )    agediff  agediff_agedummy    if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
quietly ivreg2   satis  (NRPP`x' =agedummy )    agediff  agediff_agedummy    if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
           drop( agediff agediff_agedummy  _cons)  yline(0)  title("Panel A: Life Satisfaction (baseline)", size(normarlsize)) ytitle("Effect of NRPP on Life Satisfaction", height(5) size(small)) ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)  xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
graph save "fa", replace		






***for life satisfaction,  county covariant and prov FE


local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

xi: quietly ivreg2   satis  (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
xi: quietly ivreg2   satis  (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
            drop( agediff agediff_agedummy  _cons _Iprov_* slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966)   yline(0)  title("Panel B: Life Satisfaction (county covariant + province FE)", size(normarlsize))  ysc(off)   ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)  xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
graph save "fb", replace		






***for total consumption,  baseline


local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

quietly ivreg2   logconsump  (NRPP`x' =agedummy )    agediff  agediff_agedummy    if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
quietly ivreg2   logconsump (NRPP`x' =agedummy )    agediff  agediff_agedummy    if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
           drop( agediff agediff_agedummy  _cons)  yline(0)  title("Panel C: Total Consumption (baseline)", size(normarlsize)) ytitle("Effect of NRPP on  Total Consumption", height(5) size(small)) ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)  xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
graph save "fc", replace		






***for total consumption,  county covariant and prov FE


local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

xi: quietly ivreg2   logconsump  (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
xi:quietly ivreg2   logconsump (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
            drop( agediff agediff_agedummy  _cons _Iprov_* slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966)   yline(0)  title("Panel D:  Total Consumption(county covariant + province FE)", size(normarlsize))  ysc(off)   ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)  xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
graph save "fd", replace		


graph combine fa.gph fb.gph fc.gph  fd.gph ,altshrink scheme(s1mono)	graphregion(fcolor(white)) row(2) 			  
erase fa.gph
erase fb.gph
erase fc.gph
erase fd.gph

 graph export "well.pdf", as(pdf) replace


 


 
 


**********************************************************************
**Figure 6
*********************************************************************

****medical consumption

local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

xi: quietly ivreg2   logmedical_exp   (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
xi:quietly ivreg2   logmedical_exp  (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
            drop( agediff agediff_agedummy  _cons _Iprov_* slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966)   yline(0)  title("Panel A: Meidcal Consumption (county covariant + province FE)", size(normarlsize))   ytitle("Effect of NRPP on  Consumption", height(5) size(small))  ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)  xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
graph save "fa", replace		






****clothing consumption

local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

xi: quietly ivreg2  logcloth_exp   (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
xi:quietly ivreg2  logcloth_exp  (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
            drop( agediff agediff_agedummy  _cons _Iprov_* slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966)   yline(0)  title("Panel B: Clothing Consumption (county covariant + province FE)", size(normarlsize))   ytitle("Effect of NRPP on  Consumption", height(5) size(small))  ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)  xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
graph save "fb", replace	






****food consumption

local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

xi: quietly ivreg2  logfood_exp   (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
xi:quietly ivreg2  logfood_exp  (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
            drop( agediff agediff_agedummy  _cons _Iprov_* slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966)   yline(0)  title("Panel C: Food Consumption (county covariant + province FE)", size(normarlsize))   ytitle("Effect of NRPP on  Consumption", height(5) size(small))  ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)  xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
graph save "fc", replace	





****entertainment consumption

local band 4 5 6 7 8 9 10
foreach x of local band {
gen NRPP`x'=NRPP
label var NRPP`x' "`x'"

xi: quietly ivreg2  logentertain_exp   (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death<=2.864, r cluster(pid) 
estimates store low`x'
xi:quietly ivreg2  logentertain_exp  (NRPP`x' =agedummy )    agediff  agediff_agedummy   slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966 i.prov   if age<=60+`x'&age>=60-`x'&log_death>2.864, r cluster(pid) 
estimates store high`x'
}
*


coefplot (low4 low5 low6 low7 low8 low9 low10,  offset(0.15) msymbol(O)  lpatt(solid)  lwidth(vvthin) ciopts(lpatt(solid))) /// 
  (high4 high5 high6 high7 high8 high9 high10,   offset(-0.15) msymbol(Oh) lpatt(solid)  lwidth(vvthin) ciopts(lpatt(shortdash))), ///
            p1(label(Low Revolutionary Intensity) )   p2(label(High Revolutionary Intensity)) ///
            drop( agediff agediff_agedummy  _cons _Iprov_* slope allconflict resources sulfur disaster logpop1966 revo_base pparty1966)   yline(0)  title("Panel D: Entertainment Consumption (county covariant + province FE)", size(normarlsize))   ytitle("Effect of NRPP on  Consumption", height(5) size(small))  ///		 
           vertical  legend(region(lcolor(none)) ring(0) pos(5) col(1)) graphregion(fcolor(white)) bfcolor(none)  xtitle("Bandwidth", height(3) size(small)) ///
		   ylabel(, nogrid angle(vertical) labsize(small))  xlabel(, nogrid  labsize(small))  ci(95) 
		      
  			  
drop _est_low* _est_high*
drop NRPP4-NRPP10
graph save "fd", replace	



graph combine fa.gph fb.gph fc.gph  fd.gph ,altshrink scheme(s1mono)	graphregion(fcolor(white)) row(2) 			  
erase fa.gph
erase fb.gph
erase fc.gph
erase fd.gph

 
 
 
 
 
 **********************************************************************
**Figure A1
*********************************************************************

 use "NRPP202009.dta", clear


gen density=1
gen bin=floor(agediff)
gen midbin=bin+0.5
collapse (sum) density, by(midbin)

twoway bar density midbin,  xline(0) ylabel(0(500)2000) xlabel(-20(5)20)  graphregion(color(white))   ylab(,nogrid)  ///
                       title("Panel A: Frequency of running variable (CFPS)", size(normarlsize))  ytitle("Frequency",height(5))  xtitle("Age relative to 60",height(5)) 

graph save Graph "fa.gph", replace

clear


use "CGSS2010.dta", clear
drop if age<40
drop if age>80

gen density=1
gen bin=floor(agediff)
gen midbin=bin+0.5
collapse (sum) density, by(midbin)

twoway bar density midbin,  xline(0)  xlabel(-20(5)20)  graphregion(color(white))   ylab(,nogrid)  ///
                   title("Panel B: Frequency of running variable (CGSS)", size(normarlsize))      ytitle("Frequency",height(5))  xtitle("Age relative to 60",height(5)) 

clear
graph save Graph "fb.gph", replace



gr combine fa.gph  fb.gph, altshrink scheme(s1mono)	graphregion(fcolor(white)) row(1) 	
erase fa.gph
erase fb.gph


 
 
 

**********************************************************************
**Figure A2
*********************************************************************

***covariant test

rdplot marriage agediff if age<=66&age>=54,  c(0) p(1) binselect(qspr) ///
                    graph_options(title("Marriage",size(medsmall))  xline(0) xlabel(-6[2]6) ylabel(0.8[0.05]1) ///
                     ytitle("Marriage proportion",height(5)) legend(off)   ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     graphregion(color(white)))	
graph copy marriage , replace	

rdplot party agediff if age<=66&age>=54,  c(0) p(1) binselect(qspr)   ///
                    graph_options(title("Party member",size(medsmall))  xline(0) xlabel(-6[2]6) ylabel(0[0.05]0.15) ///
                     ytitle("Party member proportion",height(5)) legend(off)   ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     graphregion(color(white)))	
graph copy party , replace	


rdplot logperincome agediff if age<=66&age>=54,  c(0) p(1) binselect(qspr)      ///
                    graph_options(title("Household income per capita",size(medsmall))  xline(0) xlabel(-6[2]6) ///
                     ytitle("Household income per capita",height(5)) legend(off)   ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     graphregion(color(white)))	
graph copy income, replace		


rdplot gender agediff if age<=66&age>=54,  c(0) p(1) binselect(qspr)  ///
                    graph_options(title("Gender (male)",size(medsmall))  xline(0) xlabel(-6[2]6) ylabel(0.3[0.1]0.7) ///
                     ytitle("Gender (male) proportion",height(5)) legend(off)   ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     graphregion(color(white)))	
graph copy gender, replace	


graph combine marriage party income gender,  rows(2) cols(2) ///
	subtitle(, color(black) fcolor(white) lcolor(white)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))
	
graph export "covariant.png", as(png) replace
	

foreach x in combine marriage party income gender{		
erase "`x'.gph" 
}

***






 
 **********************************************************************
**Figure A3
*********************************************************************

 use "NRPP202009.dta", clear
 

**local government, low			 *
rdplot perfm agediff if age<=66&age>=54&log_death<=2.864,   c(0) p(1) binselect(qspr)       ///
                    graph_options(title(Satisfaction with local government,size(medsmall))  xline(0) xlabel(-6[2]6) ylabel(3.2[0.2]3.8)  ///
                     ytitle("Satisfaction with local government",size(medsmall)) legend(off) ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     title("Panel A: Local Government, Low Revolutionary Intensity Group", size(normarlsize)) graphregion(color(white)))
graph save Graph "fa.gph", replace



**local government, high	 *
rdplot perfm agediff if age<=66&age>=54&log_death>2.864,   c(0) p(1) binselect(qspr)       ///
                    graph_options(title(Satisfaction with local government,size(medsmall))  xline(0) xlabel(-6[2]6)  ylabel(3.2[0.2]3.8) ///
                     ytitle("Satisfaction with local government",size(medsmall)) legend(off) ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     title("Panel B: Local Government, high Revolutionary Intensity Group", size(normarlsize)) graphregion(color(white)))
graph save Graph "fb.gph", replace





**trust cadre, low 
rdplot trustcadre1 agediff if age<=66&age>=54&log_death<=2.864,    c(0) p(1) binselect(qspr) ///
                    graph_options(title(Trust in Local Cadres,size(medsmall))  xline(0) xlabel(-6[2]6)  ylabel(3[0.2]3.8)   ///
                     ytitle("Trust in local cadres",size(medsmall)) legend(off) ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     title("Panel C: Local cadre, low  Revolutionary Intensity Group", size(normarlsize)) graphregion(color(white)))
graph save Graph "fc.gph", replace


**trust cadre, high
rdplot trustcadre1 agediff if age<=66&age>=54&log_death>2.864,    c(0) p(1) binselect(qspr) ///
                    graph_options(title(Trust in Local Cadres,size(medsmall))  xline(0) xlabel(-6[2]6)    ylabel(3[0.2]3.8)  ///
                     ytitle("Trust in local cadres",size(medsmall)) legend(off) ///
                     xtitle(Age relative to 60,height(5)) ylab(,nogrid)  ///
                     title("Panel D: Local cadre, high  Revolutionary Intensity Group", size(normarlsize))  graphregion(color(white)))
graph save Graph "fd.gph", replace

	
 
 gr combine fa.gph  fb.gph fc.gph fd.gph, altshrink scheme(s1mono)	graphregion(fcolor(white)) row(2) 	
erase fa.gph
erase fb.gph
erase fc.gph
erase fd.gph
 
 





 
 
